<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="社会渠道申请" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                     ng-disabled="!btnPermission.socialApplyAdd"
                    <button class="btn btn-operate m-r-sm" ng-click="addApply()"
                        title="{{!btnPermission.socialApplyAdd?'无权限执行此操作':''}}">新增</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                            ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color" ng-if="!!btnPermission.socialApplyExport">
                            <div title="导出">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                            <ul class="more-tool">
                                <li yb-download download-url="exportParam.sectionUrl"
                                    download-param="exportParam.sectionParam" download-key="ids">
                                    <i class="yb-icon ico-export-o"></i> 导出
                                </li>
                                <li yb-download download-url="exportParam.allUrl" download-param="condition"
                                    download-duration="3">
                                    <i class="yb-icon ico-export-o"></i> 导出全部
                                </li>
                            </ul>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs"
                        ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="单据编号"
                            ng-model="condition.applyNo">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">单据编号：</label>
                        <input type="text" ng-model="condition.applyNo" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">审核状态：</label>
                        <select class="form-control" ng-model="condition.status">
                            <option value="">请选择</option>
                            <option value="0">待提交</option>
                            <option value="1">待审核</option>
                            <option value="2">调度通过</option>
                            <option value="3">调度拒绝</option>
                            <option value="4">审核通过</option>
                            <option value="5">审核拒绝</option>
                        </select>
                    </div>
                    
                    <div class="form-group clearfix">
                        <label class="control-label">申请企业：</label>
                        <input type="text" ng-model="condition.applyOrgName" class="form-control">
                    </div>
                   
                    <div class="form-group clearfix">
                        <label class="control-label">申请人：</label>
                        <input type="text" ng-model="condition.applyName" class="form-control">
                    </div>

                    <div class="form-group clearfix">
                        <label class="control-label">调度人：</label>
                        <input type="text" ng-model="condition.dispatchName" class="form-control">
                    </div>

                    <div class="form-group clearfix">
                        <label class="control-label">审核人：</label>
                        <input type="text" ng-model="condition.auditName" class="form-control">
                    </div>

                    <div class="form-group clearfix m-b-none">
                        <label class="control-label">申请日期：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.applyDateStart"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDataPicker(0)"
                            is-open="datePickerFlag[0]" close-text="关闭"
                            ng-change="checkDate(condition, 'applyDateStart', 'applyDateEnd')" modal-size="small"
                            readonly>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.applyDateEnd"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDataPicker(1)"
                            is-open="datePickerFlag[1]" close-text="关闭"
                            ng-change="checkDate(condition, 'applyDateStart', 'applyDateEnd')" modal-size="small"
                            readonly>
                    </div>

                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true"
                has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="text-center th-check border-l-none">
                                        <div yb-check-box yb-checked="markInfo.allCheckedBill"
                                            yb-click="selectAll(dataList, 'Bill')"></div>
                                    </th>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth"
                                            fixed-width="tbStyle.billFixedWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td width="40" class="text-center border-l-none">
                                        <div yb-check-box yb-checked="item.isChecked"
                                            yb-click="selectSingle(item, dataList, 'Bill')"></div>
                                    </td>
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <div class="font-0" ng-if="itemCol.type === 'operate'">
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="printBill(item)"
                                                ng-disabled="!btnPermission.socialApplyPrint"
                                                title="{{!btnPermission.socialApplyPrint?'无权限执行此操作':''}}">打印</button>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="editApply(item)"
                                                ng-disabled="item.status === 1 || item.status === 2 || item.status === 4 || !btnPermission.socialApplyEdit"
                                                title="{{!btnPermission.socialApplyEdit?'无权限执行此操作':''}}">编辑</button>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="examine(item)"
                                                ng-disabled="!btnPermission.socialApplyAudit"
                                                title="{{!btnPermission.socialApplyAudit?'无权限执行此操作':''}}">审核</button>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="delApply(item)"
                                                ng-disabled="item.status != 0 || !btnPermission.socialApplyDel"
                                                title="{{!btnPermission.socialApplyDel?'无权限执行此操作':''}}">删除</button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span
                                            ng-if="(!itemCol.clickFn && itemCol.type !== 'operate') || !!itemCol.clickFn && itemCol.type == 'synSap' && item[itemCol.dataField] !== '同步失败'">{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                            ng-if="itemCol.type != 'attach' && ((!!itemCol.clickFn && itemCol.type != 'synSap') || (!!itemCol.clickFn && itemCol.type == 'synSap' && item[itemCol.dataField] === '同步失败'))">
                                            {{item[itemCol.dataField]}}
                                        </a>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                            ng-if="itemCol.type == 'attach' && !!item[itemCol.dataField]">
                                            点击下载
                                        </a>
                                        <div class="font-0" ng-if="itemCol.type === 'operate'">
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="editApply(item)"
                                                ng-disabled="(item.billStatus != '0' && item.billStatus != '3') || item.inboundEnable === 2 || !btnPermission.purchaseOrderEdit"
                                                title="{{!btnPermission.purchaseOrderEdit?'无权限执行此操作':''}}">编辑</button>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="delApply(item)"
                                                ng-disabled="item.inboundEnable === 2 || !btnPermission.purchaseOrderDel"
                                                title="{{!btnPermission.purchaseOrderDel?'无权限执行此操作':''}}">删除</button>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="cancelApply(item)"
                                                ng-disabled="item.billStatus != '1' || !btnPermission.purchaseOrderCancel"
                                                title="{{!btnPermission.purchaseOrderCancel?'无权限执行此操作':''}}">撤销</button>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="sapPost(item)"
                                                ng-disabled="item.billStatus !== '2' || item.sapStatus === 1 || !btnPermission.purchaseOrderSAP"
                                                title="{{!btnPermission.purchaseOrderSAP?'无权限执行此操作':''}}">创建采购凭证</button>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="importAttach(item)"
                                                ng-disabled="(item.billStatus != '0' && item.billStatus != '3') || !btnPermission.purchaseOrderImport"
                                                title="{{!btnPermission.purchaseOrderImport?'无权限执行此操作':''}}">上传附件</button>
                                            <!-- <button type="button" class="btn btn-operate m-r-xs" ng-click="createBarcode(item)" ng-if="btnPermission.purchaseOrderCreateBarcode"
                                                ng-disabled="item.billStatus !== '2' ||  item.printState === 2 " title="{{!btnPermission.purchaseOrderCreateBarcode?'无权限执行此操作':''}}">条码生成</button> -->
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-check-box class="m-t-xs m-r-sm" yb-checked="markInfo.allCheckedBill" yb-check-name="全选"
                    yb-click="selectAll(dataList, 'Bill')"></div>
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="{{tabFlag.name}}" active="activeFlag[2]" ng-if="activeFlag[2]">
            <form name="orderForm" class="m-t-sm form-horizontal form-up-tb border-b clearfix" novalidate>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!!orderObj.applyNo">
                    <label class="col-xs-4 control-label max-w-100">单据编号：</label>
                    <div class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.applyNo}}">
                        {{orderObj.applyNo}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">申请单位：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots">
                        {{orderObj.applyOrgName}}
                    </label>
                </div>

                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">申请人：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots">
                        {{orderObj.applyName}}
                    </label>
                </div>

                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">申请时间：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots">
                        {{orderObj.applyDate|YbDate:"yyyy-MM-dd HH:mm:ss"}}
                    </label>
                </div>

                <div class="form-group col-xs-3 m-b-sm" ng-if="!!orderObj.applyNo">
                    <label class="col-xs-4 control-label max-w-100">审核状态：</label>
                    <div class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.applyNo}}">
                        {{orderObj.statusShow}}
                    </div>
                </div>

                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>调度人：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="dispatchName" class="form-control light-bg"
                            ng-model="orderObj.dispatchName" ng-click="selectDispatch()" required yb-focus
                            placeholder="请选择">

                        <div class="msg-block"
                            ng-if="orderForm.dispatcherName.$dirty || (orderForm.dispatchName.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="orderForm.dispatchName.$error.required && !orderForm.dispatchName.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
               
            <div class="row wrapper-y-xs">
                <div class="col-xs-12 operate-bar font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addMateriel()">新增零件</button>
                    <button class="btn btn-operate m-r-sm" ng-click="selMateriel($event)">选择零件</button>
                    <button class="btn btn-operate m-r-sm" ng-click="batchDelMateriel()">批量删除</button>
                </div>
            </div>
            <div materiel-selector show-toolbar="toolbarConfig.showMateriel" sold-org-id="orderObj.soldOrgId"
                is-purchase="true" supplier-id="orderObj.orgId"
                selected-list="orderObj.detailVOList" replace-check="true"></div>
            <div ng-style="{'top':'120px'}"
                class="main-area d-b-60">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="th-check text-center">
                                        <div yb-check-box yb-checked="markInfo.allCheckedMaterial"
                                            yb-click="selectAll(orderObj.detailVOList, 'Material')"></div>
                                    </th>
                                    <th width="60" class="text-center">
                                        操作
                                    </th>
                                    <th ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        ng-if="itemCol.type !== 'rowNo'&&!itemCol.hidden" width="{{itemCol.width}}">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="materielTableConfig.targetWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderObj.detailVOList.length > 0">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in orderObj.detailVOList track by $index">
                                    <td width="40" class="text-center">
                                        <div yb-check-box yb-checked="item.isChecked"
                                            yb-click="selectSingle(item, orderObj.detailVOList, 'Material')"></div>
                                    </td>
                                    <td width="60">
                                        <button type="button" class="btn btn-operate"
                                            ng-click="delMateriel(item, $index)">删除</button>
                                    </td>
                                    <td ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        ng-if="itemCol.type !== 'rowNo'&&!itemCol.hidden" width="{{itemCol.width}}"
                                        title="{{item[itemCol.dataField]}}">
                                        <div ng-if="!itemCol.needInput" ng-class="{'danger-color': itemCol.needWarn}">
                                            <div ng-if="!item.isMenuAdd" class="spill-dots" >{{item[itemCol.dataField]}}</div>
                                            <div ng-if="item.isMenuAdd" class="td-edit pos-r">
                                                <div ng-if="itemCol.dataField=='materialsDes'">
                                                    <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                        ng-change="checkRequired(item,'materialsDes')"
                                                        ng-focus="showErrTip(item,'materialsDes')" ng-blur="hideErrTip(item,'materialsDes')"
                                                        ng-class="{'error':item.materialsDesErr||item.materialsDesShowErr}">
                                                    <div class="pos-a tool-tips" ng-if="!!item.materialsDesShowErr">
                                                        <i class="triangle"></i>
                                                        <div class="msg">零件中文名不能为空</div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.needInput">
                                            <div ng-if="itemCol.inputType === 'reason'" class="td-edit pos-r">
                                                <select name="reason" class="form-control" ng-model="item[itemCol.dataField]">
                                                    <option value="">请选择</option>
                                                    <option value= 0 >停产</option>
                                                    <option value= 1 >周期长</option>
                                                    <option value= 2 >价格高</option>
                                                    <option value= 3 >无拆分件</option>
                                                    <option value= 4 >其他原因</option>
                                                </select>
                                            </div>

                                            <div ng-if="itemCol.inputType === 'text'" class="td-edit pos-r">
                                                <input type="text" class="form-control" ng-model="item[itemCol.dataField]">
                                            </div>

                                            <div ng-if="itemCol.inputType === 'qty'" class="td-edit pos-r">
                                                <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                    yb-number-input max="9999999.99" disable-decimal="false" decimal-places="2"
                                                    ng-change="checkRequired(item,'qty')"
                                                    ng-focus="showErrTip(item,'qty')" ng-blur="hideErrTip(item,'qty')"
                                                    ng-class="{'error':item.qtyErr||item.qtyShowErr}">
                                                <div class="pos-a tool-tips" ng-if="!!item.qtyShowErr">
                                                    <i class="triangle"></i>
                                                    <div class="msg">购买数量不能为空和0</div>
                                                </div>
                                            </div>

                                            <div ng-if="itemCol.inputType === 'price'" class="td-edit pos-r">
                                                <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                    yb-number-input max="9999999.99" disable-decimal="false" decimal-places="2"
                                                    ng-change="checkRequired(item,'price')"
                                                    ng-focus="showErrTip(item,'price')" ng-blur="hideErrTip(item,'price')"
                                                    ng-class="{'error':item.priceErr||item.priceShowErr}">
                                                <div class="pos-a tool-tips" ng-if="!!item.priceShowErr">
                                                    <i class="triangle"></i>
                                                    <div class="msg">社会渠道单价(含税)不能为空</div>
                                                </div>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="orderObj.materialsList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm"
                    ng-click="saveData('save', orderForm.$valid)">保存</button>
                <button type="button" class="btn btn-primary m-r-sm"
                    ng-click="saveData('submit', orderForm.$valid)">提交</button>
                <button type="button" class="btn btn-default" ng-click="cancel()">取消</button>
            </div>
        </div>
        <div tab heading="详情" active="activeFlag[3]" ng-if="activeFlag[3]">
            <div class="m-t-sm form-up-tb clearfix">
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">单据编号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.applyNo || '-'}}">
                        {{orderObj.applyNo || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">申请企业：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.applyOrgName || '-'}}">
                        {{orderObj.applyOrgName || "-"}}
                    </div>
                </div>

                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">申请人：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.applyName || '-'}}">
                        {{orderObj.applyName||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">申请日期：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{(orderObj.applyDate|YbDate) || '-'}}">
                        {{(orderObj.applyDate|YbDate:"yyyy-MM-dd HH:mm:ss") || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">审核状态：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{(orderObj.statusShow) || '-'}}">
                        {{orderObj.statusShow || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">调度人：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.dispatchName || '-'}}">
                        {{orderObj.dispatchName || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">调度通过日期：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{(orderObj.dispatchDate|YbDate) || '-'}}">
                        {{(orderObj.dispatchDate|YbDate:"yyyy-MM-dd HH:mm:ss") || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">调度人审核意见：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.dispatchRemark || '-'}}">
                        {{orderObj.dispatchRemark || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">审核人：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.auditName || '-'}}">
                        {{orderObj.auditName || "-"}}
                    </div>
                </div>
            
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">审核通过日期：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{(orderObj.auditDate|YbDate) || '-'}}">
                        {{(orderObj.auditDate|YbDate:"yyyy-MM-dd HH:mm:ss") || "-"}}
                    </div>
                </div>

                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">审核人审核意见：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.auditRemark || '-'}}">
                        {{orderObj.auditRemark || "-"}}
                    </div>
                </div>

            </div>
            <div class="panel-bar clearfix">
                <div class="pull-left">
                    <i></i>零件信息
                </div>
            </div>
            <div class="main-area d-b-60" ng-style="{'top':'180px'}">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        ng-if="!itemCol.hidden" width="{{itemCol.width}}">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="editMaterielConfig.scrollWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderObj.detailVOList.length > 0">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in orderObj.detailVOList track by $index">
                                    <td class="spill-dots"
                                        ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}"
                                        ng-if="!itemCol.hidden">
                                        <!-- {{item[itemCol.dataField]}} -->
                                        <div class="spill-dots" ng-if="!itemCol.needInput || itemCol.inputType !== 'reason'"
                                        ng-class="{'danger-color': itemCol.needWarn}">
                                        {{item[itemCol.dataField]}}
                                        </div>

                                    <div ng-if="itemCol.needInput && itemCol.inputType === 'reason'"
                                        class="td-edit pos-r">
                                        <select name="reason" class="form-control" ng-model="item[itemCol.dataField]" disabled>
                                            <option value="">请选择</option>
                                            <option value= 0 >停产</option>
                                            <option value= 1 >周期长</option>
                                            <option value= 2 >价格高</option>
                                            <option value= 3 >无拆分件</option>
                                            <option value= 4 >其他原因</option>
                                        </select>
                                    </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="orderObj.materialsList.length === 0">暂时没有数据
                    </div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-default" ng-click="cancel()">返回</button>
            </div>
        </div>
        <div tab heading="编辑采购申请" active="activeFlag[10]" ng-if="activeFlag[10]">
            <form name="orderForm" class="m-t-sm form-horizontal form-up-tb clearfix" novalidate>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">采购单号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.billNo || '-'}}">
                        {{orderObj.billNo || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">采购计划单号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.buyPlanOrder || '-'}}">
                        {{orderObj.buyPlanOrder || "-"}}
                    </div>
                </div>

                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">接收单位：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.supplierOrgName || '-'}}">
                        {{orderObj.supplierOrgName||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">出票方：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.drawerOrgName || '-'}}">
                        {{orderObj.drawerOrgName||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">采购组：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.purchaseGroup || '-'}}">
                        {{orderObj.purchaseGroup||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">申请时间：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{(orderObj.createDate|YbDate) || '-'}}">
                        {{(orderObj.createDate|YbDate:"yyyy-MM-dd HH:mm:ss") || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">申请单位：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.purchaseOrgName || '-'}}">
                        {{orderObj.purchaseOrgName || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">调度员：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.dispatcherName || '-'}}">
                        {{orderObj.dispatcherName || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">采购方式：</label>
                    <div class="col-xs-8 wrapper-none spill-dots"
                        title="{{orderObj.purchaseTypeChildId ? orderObj.typeDesc + '-' + orderObj.purchaseTypeChildName : orderObj.typeDesc}}">
                        {{orderObj.purchaseTypeChildId ? orderObj.typeDesc + "-" + orderObj.purchaseTypeChildName : orderObj.typeDesc}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">发货方式：</label>
                    <div class="col-xs-8 wrapper-none spill-dots"
                        title="{{orderObj.sendTypeChildId ? orderObj.shippingMethod + '-' + orderObj.sendTypeChildName : orderObj.shippingMethod}}">
                        {{orderObj.sendTypeChildId ? orderObj.shippingMethod + "-" + orderObj.sendTypeChildName : orderObj.shippingMethod}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">收货人：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.receiverName || '-'}}">
                        {{orderObj.receiverName || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">联系方式：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.receiverTel || '-'}}">
                        {{orderObj.receiverTel || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">传真：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.receiverFax || '-'}}">
                        {{orderObj.receiverFax || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">收货地址：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.receiverAddress || '-'}}">
                        {{orderObj.receiverAddress || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">状态：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.statusDesc || '-'}}">
                        {{orderObj.statusDesc || '-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">审核人：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.auditName || '-'}}">
                        {{orderObj.auditName || '-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">审核时间：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{(orderObj.auditDate|YbDate) || '-'}}">
                        {{(orderObj.auditDate|YbDate:"yyyy-MM-dd HH:mm:ss") || '-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">审核意见：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.auditMessage || '-'}}">
                        {{orderObj.auditMessage || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">国家和地区：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.country || '-'}}">
                        {{orderObj.country || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">机型：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.model || '-'}}">
                        {{orderObj.model || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">备注：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.remark || '-'}}">
                        {{orderObj.remark || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">库区编码：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.sapInArea || '-'}}">
                        {{orderObj.sapInArea || "-"}}
                    </div>
                </div>
                <!-- <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">采购凭证：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.voucherNo || '-'}}">
                        {{orderObj.voucherNo || "-"}}
                    </div>
                </div> -->
                <!-- <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">同步状态：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.sapStatusShow || '-'}}">
                        {{orderObj.sapStatusShow || "-"}}
                    </div>
                </div> -->
                <!-- <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">是否直投订单：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{(orderObj.isDirectCast|TrueOrFalse) || '-'}}">
                        {{(orderObj.isDirectCast|TrueOrFalse) || '-'}}
                    </div>
                </div> -->
                <div class="form-group col-xs-3 m-b-sm" ng-if="orderObj.isDirectCast === 1">
                    <label class="col-xs-4 m-b-n text-right max-w-100">直投达标金额：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.directLimit || '-'}}">
                        {{orderObj.directLimit || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="orderObj.isDirectCast === 1">
                    <label class="col-xs-4 m-b-n text-right max-w-100">送达方：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.deliveryOrgName || '-'}}">
                        {{orderObj.deliveryOrgName || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="orderObj.isDirectCast === 1">
                    <label class="col-xs-4 m-b-n text-right max-w-100">供货商：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.soldOrgName || '-'}}">
                        {{orderObj.soldOrgName || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="orderObj.isDirectCast === 1">
                    <label class="col-xs-4 m-b-n text-right max-w-100">来源单号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.directSourceOrder || '-'}}">
                        {{orderObj.directSourceOrder || "-"}}
                    </div>
                </div>
            </form>
            <div class="panel-bar clearfix">
                <div class="pull-left">
                    <i></i>零件信息
                </div>
            </div>
            <div class="main-area d-b-60"
                ng-style="{'top':(!!orderObj.billNo || orderObj.isDirectCast === 1 || currentUserInfo.isSap)?'285px':'245px'}">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="th-check text-center">
                                        <div yb-check-box yb-checked="markInfo.allCheckedMaterial"
                                            yb-click="selectAll(orderObj.materialsList, 'Material')"></div>
                                    </th>
                                    <th width="60" class="text-center">
                                        操作
                                    </th>
                                    <th ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        ng-if="itemCol.type !== 'rowNo'&&!itemCol.hidden" width="{{itemCol.width}}">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="materielTableConfig.targetWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderObj.materialsList.length > 0">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in orderObj.materialsList track by $index">
                                    <td width="40" class="text-center">
                                        <div yb-check-box yb-disabled="item.sendQty != 0" yb-checked="item.isChecked"
                                            yb-click="selectSingle(item, orderObj.materialsList, 'Material')"></div>
                                    </td>
                                    <td width="60">
                                        <button type="button" class="btn btn-operate" ng-disabled="item.sendQty != 0"
                                            ng-click="delMateriel(item, $index)">删除</button>
                                    </td>
                                    <td ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        ng-if="itemCol.type !== 'rowNo'&&!itemCol.hidden" width="{{itemCol.width}}"
                                        title="{{item[itemCol.dataField]}}">
                                        <div class="spill-dots" ng-if="!itemCol.needInput && !itemCol.input"
                                            ng-class="{'danger-color': itemCol.needWarn}">
                                            {{item[itemCol.dataField]}}
                                        </div>
                                        <div ng-if="!!itemCol.input && itemCol.inputType === 'price' "
                                            class="td-edit pos-r">
                                            {{item[itemCol.dataField]}}

                                        </div>
                                        <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]"
                                            select-obj="chosePriceScheme(item, $parent.$parent.$index)"
                                            clear-form="clearPriceScheme(item)" tips-name="价格方案"
                                            ng-if="!!itemCol.input && itemCol.inputType === 'func'"
                                            title="{{item[itemCol.dataField]}}"></div>

                                        <div ng-if="itemCol.needInput && itemCol.inputType === 'qty'" class="td-edit pos-r">
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                yb-number-input max="9999999.99" disable-decimal="false" decimal-places="2"
                                                ng-change="checkRequired(item,'qty')"
                                                ng-focus="showErrTip(item,'qty')" ng-blur="hideErrTip(item,'qty')"
                                                ng-class="{'error':item.qtyErr||item.qtyShowErr}">
                                            <div class="pos-a tool-tips" ng-if="!!item.qtyShowErr">
                                                <i class="triangle"></i>
                                                <div class="msg">购买数量不能为空和0</div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.needInput && itemCol.inputType === 'netPrice'&&!itemCol.hidden"
                                            class="td-edit pos-r">
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                yb-number-input max="9999999.99"
                                                maxlength="10" disable-decimal="false" decimal-places="2">
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'time'" class="td-edit pos-r"
                                            title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control date-picker cursor-pointer"
                                                ng-model="item[itemCol.dataField]" datepicker-popup="{{'yyyy-MM-dd'}}"
                                                ng-click="switchListDatePicker(item)" at-right="true"
                                                is-open="item.showDatePicker" close-text="关闭"
                                                ng-class="{'error': item.dateErr && !item[itemCol.dataField]}" readonly>
                                            <div class="pos-a tool-tips"
                                                ng-if="!!item.dateErr && !item[itemCol.dataField]">
                                                <i class="triangle"></i>
                                                <div class="msg">交货日期不能为空</div>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="orderObj.materialsList.length === 0">暂时没有数据
                    </div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm"
                    ng-click="saveData('submit', orderForm.$valid)">提交</button>
                <button type="button" class="btn btn-default" ng-click="cancel()">取消</button>
            </div>
        </div>
    </div>
</div>